import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false
import store from './store/index.js'
Vue.prototype.$store = store;

//权限跳转
Vue.prototype.navigateTo = (options) => {
	if (!store.state.user.loginStatus) {
		uni.showToast({
			title: "请先登录",
			icon: "none"
		})
		return uni.navigateTo({
			url: "/pages/login/login"
		})
	}
	uni.redirectTo(options)
}


// #ifdef VUE2 

// ifndef和ifdef是一对不能混写 https://blog.csdn.net/graciedu/article/details/127870657
//自带vuex  可以直接使用

App.mpType = 'app'
const app = new Vue({
	store,
	...App
})
app.$mount()
// #endif